import { type Option } from "@/components/MiniBpmn/types";
import { getRoleList } from '@/components/MiniBpmn/api';

class RoleData {
  options: Option[] = [];

  async initData() {
    const res = await getRoleList();

    const treeMap = (item: any): Option => {
      return {
        label: item.name,
        value: item.id,
      };
    };
    this.options = (res.data || []).map(treeMap);
  }
}

export default RoleData;